#include "message.h"

Message::Message()
{
	message = NULL;
	font = NULL;
	if (TTF_Init() == -1)
		exit(0);
	font = TTF_OpenFont("pic/Ubuntu.ttf", 24);
}

void Message::EndGame(int who)
{
	SDL_Color textColor = {255, 255, 255};
	if (who == 0)
		message = TTF_RenderText_Solid(font, 
					       "Dealer win", textColor);
	else if (who == 1)
		message = TTF_RenderText_Solid(font, "Human win", textColor);
	
	init.MySDL_ApplySurface(COMPUTER_X-300, COMPUTER_Y+230, message,
				init.GetScreenAddress());
}

void Message::Lose()
{
	SDL_Color textColor = {255, 255, 255};
	message = TTF_RenderText_Solid(font, 
				"End of game", textColor);

	init.MySDL_ApplySurface(COMPUTER_X-300, COMPUTER_Y+260, message,
				init.GetScreenAddress());
}